<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/8/11
 * Time: 15:17
 */

namespace App\Http\Controllers\Web;


use App\Http\Controllers\Controller;
use App\Service\AdministratorService;
use App\Service\FloorRoomService;
use App\Service\OrderService;
use Illuminate\Http\Request;

class IndexController extends Controller
{
    public function index()
    {
        return view('index');
    }

    /**
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function deliveryData()
    {
        $params = Request()->post();
        return OrderService::deliveryData($params);
    }


    public function getStatistics()
    {
        $params = Request()->post();
        return OrderService::getStatistics($params);
    }

    public function getUserStatistics()
    {
        $params = Request()->post();
        return OrderService::getUserStatistics($params);
    }

    public function getAllUser()
    {
        return AdministratorService::getAllUser();
    }

    public function getAllBuilding()
    {
        $params = Request()->post();
        $params['status'] = 1;
        return FloorRoomService::getAllBuilding($params);
    }

    public function getAllFloor()
    {
        $params = Request()->post();
        $params['status'] = 1;
        return FloorRoomService::getAllFloor($params);
    }

    public function getAllRoom()
    {
        $params = Request()->post();
        $params['status'] = 1;
        return FloorRoomService::getAllRoom($params);
    }



}
